<?php

namespace app\common\model;

use think\Model;

class User extends Model
{
    //
    static function is_exist($name,$mobile){
        $me = new self();
        $res = $me
            ->whereOr(["user_name"=>$name])
            ->whereOr(["mobile"=>$mobile])
            ->find();
        return !!$res;
    }
    static function addUser($name,$mobile,$password){
        $me = new self();
        $me->insert([
            "user_name"=>$name,
            "mobile"=>$mobile,
            "password"=>$password,
        ]);
        $res = $me->where(["user_name"=>$name])->find();
        return $res;
    }
}
